package com.shelpe.services.sinbad.dto;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.shelpe.services.sinbad.entity.jpa.MobileKeywordsDetail;

import lombok.Data;

/**
 * @description 养分关键词 前端模型 基于adgroup
 * 
 * @author letian@shelpe.com
 * @date 2017年8月28日 下午7:01:56
 */
@Data
public class MobileKeywordsDto {
	
	@JsonProperty("mobile_adgroup_id")
	private long mobileAdgroupID;
	
	@JsonProperty("keyword_id")
	private long keywordID;
	
	@JsonProperty("word")
	private String word;
	
	@JsonProperty("start_score")
	private int startQscore;
	
	@JsonProperty("end_score")
	private int endQscore;
	
	@JsonProperty("impressions")
	private int impressions;
	
	@JsonProperty("click")
	private int click;
	
	@JsonProperty("error")
	private String error;
	
	@JsonProperty("status")
	private Integer status;//starting(1), success(2), error(3), exception(4);
	
	public void from(MobileKeywordsDetail detail){
		this.mobileAdgroupID = detail.getMobileAdgroupID();
		this.keywordID = detail.getKeywordID();
		this.word = detail.getWord();
		this.startQscore = detail.getStartQscore();
		this.endQscore = detail.getEndQscore();
		this.status = detail.getStatus().getValue();
		this.error = detail.getError();
	}
}
